<template>
	<view class="page-body">
		<view class="content">
			<view class="list">
				<!-- <view class="row">
					<view class="title">头像</view>
					<view class="right"><view class="tis">
					<image src="/static/img/face.jpg" mode="widthFix"></image>
					</view><view class="icon xiangyou"></view></view>
				</view> -->
				<!-- <view class="row" @click="goUsersetting">
					<view class="title">昵称</view>
					<view class="right"><view class="tis">大黑哥</view><view class="icon xiangyou"></view></view>
				</view> -->
			
				<view class="row" @click="goModifyPwd">
					<view class="title">修改密码</view>
					<view class="right"><view class="tis"></view><view class="icon xiangyou"></view></view>
				</view>
				<view class="row" @click="goFindPwd">
					<view class="title">忘记密码</view>
					<view class="right"><view class="tis"></view><view class="icon xiangyou"></view></view>
				</view>
			<!-- 	<view class="row" @click="goAccout">
					<view class="title">账户开通</view>
					<view class="right"><view class="tis">{{isOpen?'已开通':'未开通'}}</view><view class="icon xiangyou"></view></view>
				</view> -->
			</view>
			<view class="list">
				<!-- <view class="row">
					<view class="title">通知提醒</view>
					<view class="right"><view class="tis"></view> <switch></switch></view>
				</view> 
				<view class="row" @click="paySetting">
					<view class="title" >支付设置</view>
					<view class="right"><view class="tis"></view><view class="icon xiangyou"></view></view>
				</view>-->
				<!-- <view class="row">
					<view class="title">通用</view>
					<view class="right"><view class="tis"></view><view class="icon xiangyou"></view></view>
				</view> -->
			</view>
			<view class="list">
				
				
				<!-- <view class="row" @click="goFeedback">
					<view class="title">问题反馈</view>
					<view class="right"><view class="tis"></view><view class="icon xiangyou"></view></view>
				</view> -->
				<view class="row" @click="goAboutus">
					<view class="title">关于五折MALL</view>
					<view class="right"><view class="tis"></view><view class="icon xiangyou"></view></view>
				</view>
				<view class="row">
					<view class="title">当前版本</view>
					<view class="right"><view class="tis">v{{version}}</view></view>
				</view>
				<view class="row">
					<view class="title">清除缓存</view>
					<view class="right"><view class="tis"></view><view class="icon xiangyou"></view></view>
				</view>
			</view>
			<view class="btn-out" @click="loginout">退出登录</view>
		</view>
	</view>
</template>

<script>
	import {
	    mapState,
	    mapMutations
	} from 'vuex'
	var that;
	export default {
		data() {
			return {
				version:"1.0.0"
			};
		},
		onLoad(){
			that=this;
			// #ifdef APP-PLUS
			this.getVersion()
			// #endif
		},
		methods: {
			...mapMutations(['logout']),
			showType(tbIndex){
				this.tabbarIndex = tbIndex;
				this.list = this.orderList[tbIndex];
			},
			goFindPwd(){
				uni.navigateTo({
					url:"/pages/user/setting/password/forgetpwd"
				})
			},
			goModifyPwd(){
				uni.navigateTo({
					url:"/pages/user/setting/password/modifypwd"
				})
			},
			goUsersetting(){
				uni.navigateTo({
					url:"/pages/user/setting/usersetting"
				})
			},
			goAccout(){
				uni.navigateTo({
					url:"/pages/user/SAM/SAM"
				})
			},
			goFeedback(){
				uni.navigateTo({
					url:"/pages/user/setting/feedback"
				})
			},
			goAboutus(){
				uni.navigateTo({
					url:"/pages/user/setting/aboutus"
				})
			},
			paySetting(){
				uni.navigateTo({
					url:"/pages/user/SAM/payword"
				})
			},
			loginout(){
				this.$https.POST({
					url:'/public/logout',
					data:{
					},
					success(res){
						that.logout()
						uni.switchTab({
							url:"/pages/tabBar/user/user"
						})
					}
				})
			},
			clearCache(){//清除图片缓存
				plus.io.resolveLocalFileSystemURL("_doc/image", function(res){
					res.removeRecursively((entry)=>{
						console.log("remove success")
					})
				},(res)=>{
					console.log(res)
				});
			},
			getVersion(){
				plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {  
					that.version=widgetInfo.version
				})
			}
		},
		computed:mapState({
			isOpen(state){
				return state.isOpenAccount;
			}
		})
	}
</script>

<style lang="scss">
page{
	background-color: #f3f3f3;	
}

.icon {
	font-size: 30upx;

}
.content{
	padding-bottom: 20upx;
	.list{
		background-color: #fff;
		margin-bottom: 20upx;
		.row{
			padding: 0 30upx 0 40upx;
			min-height: 90upx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			border-bottom: solid 1upx #eee;
			&:last-child{
				border-bottom: none;
			}
			.title{
				font-size: 32upx;
				color: #333;
			}
			.right{
				display: flex;
				align-items: center;
				color: #999;
				.tis{
					font-size: 26upx;
					margin-right: 5upx;
					max-height: 120upx;
					image{
						width: 100upx;
						height: 100upx;
						border-radius: 100%;
						margin: 10upx 0;
					}
				}
				.icon{
					width: 40upx;
					color: #cecece;
				}
			}
			
		}
	}
}

.btn-out{
    color: #0e1327;
    margin-top: 30px;
    font-size: 16px;
	background: #fff;
	height: 44px;
	line-height: 44px;
	text-align: center;
	font-size: 16px;
	color: $maincolor;
}
</style>
